using SalesPoint.Model;
using Xtensive.Orm;
using Xtensive.Orm.Security;

namespace SalesPoint.Security
{
  public class SalesPresidentRole : SalesManagerRole
  {
    protected override void RegisterPermissions()
    {
      // Sales president inherits Sales manager permissions
      base.RegisterPermissions();

      // Sales President can read all, but can't alter any details, except employees. They need read-only aggregated reports, actually
      RegisterPermission(new Permission<Customer>());
      RegisterPermission(new OrderPermission(false, false));
      RegisterPermission(new Permission<Product>());
      RegisterPermission(new Permission<Employee>(true));

    }
    public SalesPresidentRole(Session session)
      : base(session)
    {
    }
  }
}
